const app = {
	namespaced: true,
	state: {
		selectColor: null, //当前选中的颜色 , g, b], value: 'rgb(r, g, b)'}
		modeSource: {
			label: '全局',
			modeList: [{
					label: '渐变',
					modeType: {
						type: 0,
						LV_DO: true
					},
					disabled: true,
					colors: []
				},
				{
					label: '跳变',
					modeType: {
						type: 1,
						LV_DO: true
					},
					disabled: true,
					colors: []
				},
				{
					label: '闪屏',
					modeType: {
						type: 2,
						LV_DO: true
					},
					disabled: true,
					colors: []
				},
				{
					label: '呼吸',
					modeType: {
						type: 3,
						LV_DO: true
					},
					disabled: true,
					colors: []
				},
				{
					label: '律动渐变',
					modeType: {
						type: 4,
						LV_DO: true
					},
					disabled: true,
					colors: []
				},
				{
					label: '律动跳变',
					modeType: {
						type: 5,
						LV_DO: true
					},
					disabled: true,
					colors: []
				},
				{
					label: '',
					colors: null,
					modeType: null
				},
				{
					label: '',
					colors: null,
					modeType: null
				},
				{
					label: '',
					colors: null,
					modeType: null
				},
			],
			modeCtrlList: [{
					label: '亮度',
					value: 1,
					type: 1,
					max: 100,
					min: 1
				},
				{
					label: '速度',
					value: 1,
					type: 2,
					max: 100,
					min: 1
				},
				{
					label: '灵敏度',
					value: 1,
					type: 3,
					max: 100,
					min: 1
				},
			],
		},
		modeParams: {
			modeSelectIndex: -1, //当前模式操作的下标
			customSelectIndex: -1, //当前自定义选择的模式下标
		}
	},
	mutations: {
		SET_SELECT_COLOR(state, value) {
			state.selectColor = value;
		},
		SET_MODE_SOURCE(state, data) {
			state.modeSource = data;
		},
		SET_MODE_PARAMS(state, o) {
			state.modeParams = { ...state.modeParams,
				...o
			};
		}
	},
	actions: {
		setSelectColor({
			commit
		}, value) {
			commit('SET_SELECT_COLOR', value)
		},
		setModeSource({
			commit
		}, data) {
			commit('SET_MODE_SOURCE', data)
		},
		setModeParams({
			commit
		}, o) {
			commit('SET_MODE_PARAMS', o)
		}
	}
}

export default app;
